cmake_minimum_required(VERSION 2.8)
get_filename_component(_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(_TARGET "fx${_DIR_NAME}")
find_package (Qt5Widgets)

file(GLOB _HEADERS ${FUXI_INCLUDEDIR}/${_DIR_NAME}/*.h)
file(GLOB _SOURCES *.cpp)
file(GLOB _UIS res/*.ui)

qt5_wrap_cpp(_HEADERS_MOC ${_HEADERS})
qt5_wrap_ui (_UIS_MOC  ${_UIS})

STRING( REGEX REPLACE ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} UI_MOC_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR})
include_directories (${UI_MOC_INCLUDE})

SET(TARGET_SRC ${_HEADERS_MOC} ${_UIS_MOC} ${_HEADERS} ${_SOURCES})

add_executable(${_TARGET} ${TARGET_SRC})
install(TARGETS ${_TARGET} RUNTIME DESTINATION bin)

# Target libraries
target_link_libraries(${_TARGET} ${FUXI_THIRD_LIBRARIES} Qt5::Widgets fxbase)







